<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>6.全局和局部注册</title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        <component-a></component-a>
        <component-b></component-b>
    </div>
    <script>
        // 全局注册
        Vue.component('component-a', {template: '<h4>A</h4>'})
        // 局部注册
        var ComponentB = { template: '<h4>B</h4>' }
        new Vue({
            el: '#app',
            components: {
                'component-b': ComponentB
            }
        })
    </script>
</body>

</html>